﻿using UnityEngine;
using System.Collections;
using PBMessage;
public class Mover
{
    protected Unit mUnit;
    protected bool isStart = false;
    public virtual void Start(Unit unit)
    {
        mUnit = unit;
        isStart = true;
    }

    public virtual void ServerUpdate(long dt) { }
}


public class MoverManager:SGLib.Singleton<MoverManager>
{

    public void Load()
    {

    }

    public Mover CreateMover(string moverName)
    {
        return null;
    }

    public Mover CreateMover(SC_UnitAddMover mover)
    {
        switch (mover.MoverType)
        {
            case "LineMover":
                LineMover lineMover = new LineMover();
                lineMover.StartTime = mover.Time;
                lineMover.Speed = mover.Int324;
                lineMover.MoveDistance = mover.Int323;
                lineMover.Dir = new Vector3(mover.Int320/100f, mover.Int321 / 100f, mover.Int322 / 100f);
                lineMover.StartPos = new Vector3(mover.PosX / 100f, mover.PosY / 100f, mover.PosZ / 100f);
                return lineMover;
        }
        return null;
    }
}
